home *** CD-ROM | disk | FTP | other *** search
- regc4f( 5, %daycolor_r, %daycolor_g, %daycolor_b, %daycolor_a )
- regc4f( 7, %ambient_r, %ambient_g, %ambient_b, %ambient_a )
-
- hlsl("
-
- #include <../common_hlsl.h>
-
- const HALF3 DayColor : register(c5);
- const HALF4 Ambient : register(c7);
-
- sampler2D s0;
- sampler2D s1;
- sampler2D s2;
-
- float4 main( float2 uv : TEXCOORD0,
- float3 l_dir : TEXCOORD1,
- float3 e_dir : TEXCOORD2,
- float2 ctg : TEXCOORD3 ) : COLOR {
-
- float4 height = tex2D( s1, uv );
-
- float3 l = normalize( l_dir );
- float3 e = normalize( e_dir );
-
- uv.xy += e*(height.w*.02 - .01);
-
- float4 color = tex2D( s0, uv );
- float3 normal = tex2D( s1, uv )*2 - 1;
- float4 clouds = tex2D( s2, ctg );
-
- float3 h = normalize( e + l );
-
- float kd = saturate( dot(l, normal) );
- float ks = saturate( dot(h, normal) );
-
- ks = pow( ks, 64 );
-
- kd = (1-clouds.w)*kd*Ambient+Ambient.w;
- ks = (1-clouds.w)*ks;
-
- color = color*kd + (float4)ks*.2;
-
- color.rgb *= DayColor;
- return color;
- }
-
-
-
- ")
-
-
-